<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //原型对象里面默认都有一个constructor
    function Star(){

    }
    // Star.prototype.sing = function(){
    //     console.log('唱歌');
    // };
    // Star.prototype.dance = function(){
    //     console.log('跳舞');
    // };
    Star.prototype = {
        constructor:Star,
        sing:function(){
            console.log('唱歌');
        },
        dance:function(){
            console.log('跳舞');
        }
    }
    //丢失constructor，需要重新指回原型对象的构造函数
    console.log(Star.prototype);
</script>
</html>